from __future__ import division
from jinja2.runtime import LoopContext, TemplateReference, Macro, Markup, TemplateRuntimeError, missing, concat, escape, markup_join, unicode_join, to_string, TemplateNotFound
name = '/themes/default/listing.html'

def root(context, environment=environment):
    parent_template = None
    block_context = context._block()
    l_config = context.resolve('config')
    if 0: yield None
    parent_template = environment.get_template(('blog/themes/%s/base.html' % environment.getattr(l_config, 'theme')), '/themes/default/listing.html')
    for name, parent_block in parent_template.blocks.iteritems():
        context.blocks.setdefault(name, []).append(parent_block)
    for event in parent_template.root_render_func(context):
        yield event

def block_body(context, environment=environment):
    l_next_page = context.resolve('next_page')
    l_prev_page = context.resolve('prev_page')
    l_no_post = context.resolve('no_post')
    l_config = context.resolve('config')
    l_posts = context.resolve('posts')
    t_1 = environment.filters['date']
    t_2 = environment.filters['safe']
    t_3 = environment.filters['e']
    if 0: yield None
    yield u'\n\t\n\t'
    if l_no_post:
        if 0: yield None
        yield u'\n\t  <h2>Welcome to the The O-Kay-Blog</h2>\n\t\t<p>Your flashy new blog needs some content!</p>\n\t\t<p>Create some new posts at the Admin Page.</p>\n\t\t<p>\n\t\t<a href="/admin/newpost">Go to the Admin Page.</a>\n\t\t</p>\t\n\t'
    yield u'\n  '
    l_post = missing
    l_config = context.resolve('config')
    for l_post, l_loop in LoopContext(l_posts):
        if 0: yield None
        yield u'\n    <h2><a href="%s">%s</a></h2>\n    <p class="post-info">\n      Posted by %s\n      ' % (
            escape(environment.getattr(l_post, 'path')), 
            escape(t_3(environment.getattr(l_post, 'title'))), 
            escape(environment.getattr(l_config, 'author_name')), 
        )
        if environment.getattr(l_post, 'tags'):
            if 0: yield None
            yield u'\n        | Filed under\n        '
            t_4 = l_loop
            l_tag = missing
            for l_tag, l_loop in LoopContext(environment.getattr(l_post, 'tag_pairs')):
                if 0: yield None
                yield u'\n          <a href="/tag/%s">%s</a>' % (
                    escape(t_3(environment.getitem(l_tag, 1))), 
                    escape(t_3(environment.getitem(l_tag, 0))), 
                )
                if (not environment.getattr(l_loop, 'last')):
                    if 0: yield None
                    yield u','
                yield u'\n        '
            l_loop = t_4
            l_tag = missing
            yield u'\n      '
        yield u'\n    </p>\n    %s\n    <p class="postmeta">\n      <a href="%s" class="readmore">Read more</a>\n      ' % (
            escape(t_2(environment.getattr(l_post, 'summary'))), 
            escape(environment.getattr(l_post, 'path')), 
        )
        if environment.getattr(l_config, 'disqus_forum'):
            if 0: yield None
            yield u'\n       | <a href="%s#disqus_thread" class="readmore">Comments</a>\n      ' % (
                escape(environment.getattr(l_post, 'path')), 
            )
        yield u'\n      <span class="date">%s</span>\n    </p>\n  ' % (
            escape(t_1(environment.getattr(l_post, 'published'), '%d %B, %Y')), 
        )
    l_post = missing
    yield u'\n  '
    if l_prev_page:
        if 0: yield None
        yield u'\n    <a id="prev" href="%s">Newer</a>\n  ' % (
            escape(l_prev_page), 
        )
    yield u'\n  '
    if l_next_page:
        if 0: yield None
        yield u'\n    <a id="next" href="%s">Older</a>\n  ' % (
            escape(l_next_page), 
        )
    yield u'\n  '
    if environment.getattr(l_config, 'disqus_forum'):
        if 0: yield None
        yield u'\n    <script type="text/javascript">\n    //<![CDATA[\n    (function() {\n      var links = document.getElementsByTagName(\'a\');\n      var query = \'?\';\n      for(var i = 0; i < links.length; i++) {\n      if(links[i].href.indexOf(\'#disqus_thread\') >= 0) {\n        query += \'url\' + i + \'=\' + encodeURIComponent(links[i].href) + \'&\';\n      }\n      }\n      document.write(\'<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/%s/get_num_replies.js\' + query + \'"></\' + \'script>\');\n    })();\n    //]]>\n    </script>\n  ' % (
            escape(environment.getattr(l_config, 'disqus_forum')), 
        )
    yield u'\n'

def block_title(context, environment=environment):
    l_config = context.resolve('config')
    if 0: yield None
    yield escape(environment.getattr(l_config, 'blog_name'))

blocks = {'body': block_body, 'title': block_title}
debug_info = '1=10&3=16&5=27&12=30&13=33&14=36&16=38&17=40&19=45&20=48&21=57&22=58&24=59&26=60&27=62&28=65&29=67&30=68&32=71&33=72&34=75&35=77&36=78&37=81&38=83&39=84&50=87&54=89&2=91'